<template>
  <!-- 相关推荐 -->
  <div class="xgtj">
    <p class="fontHt xgtj-bt">相关推荐</p>
    <div class="listBox" v-for="(item, index) in list.items" :key="index">
      <div class="listImg">
        <img v-if="item.vImg !== 'c'" :src="item.vImg">
        <svg-animation v-if="item.vImg === 'c' || item.vImg === ''"></svg-animation>
        <svg-animation2 v-if="item.vImg === '' || item.vImg === null || item.vImg === undefined"></svg-animation2>
        <img v-if="item.vImg === 'c' || item.vImg === ''" class="backImgOne" src="http://mcgamehome.love/img/loading.png" alt="http://mcgamehome.love/img/loading.png">
      </div>
      <div class="listTitle">
        <div class="fjTitle">
          <span class="fontHt" :title="item.vName">{{item.vName}}</span>
        </div>
        <div class="listTitleBottom">
          <div class="juji">
            <span v-if="!item.vIndex">更新至<span>{{item.vEpic}}</span>集</span>
            <span v-if="item.vIndex">全<span>{{item.vEpic}}</span>集</span>
          </div>
          <div class="bfsj">
            {{ item.vData.split(',')[0] }}亿播放&nbsp;&nbsp;·&nbsp;&nbsp;{{ item.vData.split(',')[1] }}万弹幕
          </div></div>
      </div>
    </div>
  </div>
</template>

<script setup>

import {onMounted, reactive} from 'vue'
import API from '@/api/AxiosConfig'
import SvgAnimation from "@/components/svgAnimation";
import SvgAnimation2 from "@/components/svgAnimation2";
const list = reactive({
  items: [],

})

onMounted(() => {
  API({ url: '/api/doLike', method: 'get' }).then(res => {
    list.items = res.data
    // console.log(res.data)
  }).catch(err => {
    // console.log(err)
  })
})
</script>

<style lang="less" scoped>
.backImgOne{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
.fontHt{
  font-family: "黑体";
  font-weight: bold;
}
/* 相关推荐 */
.xgtj-bt{
  margin-top: 10px;
  font-size: 18px;
}
.fjTitle{
  position: relative;
  color: #18191c;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
.juji{
  color: #999;
  font-size: 12px;
  margin-bottom: 4px;
  height: 15px;
}
.bfsj{
  color: #999;
  font-size: 12px;
  margin-bottom: 3px;
  height: 15px;
}
.listBox{
  display: flex;
  width: 100%;
  height: 100%;
  margin: 15px 0;
}
.listTitle{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-left: 10px;
  overflow: hidden;
}
.listTitleBottom{
  display: flex;
  flex-direction: column;
}
.listImg{
  position: relative;
  min-width: 140px;
  max-width: 140px;
  height: 80px;
  display: flex;
  justify-content: center;
  border-radius: 4px;
  overflow: hidden;
}
.listImg>img{
  width: 100%;
}
@media (min-width: 1681px) {
  .listImg {
    display: flex;
    min-width: 189px;
    height: 107px;
    border-radius: 4px;
    overflow: hidden;
  }
}

</style>
